/*
 * @Author: yc
 * @Date: 2020-05-26 20:02:36
 * @LastEditTime: 2020-05-29 10:45:03
 * @FilePath: \react-admin\src\routes\index.js
 */
import {
  Login,
  NotFound,
} from '../pages'
import path from 'path'

const resolve = (url) => path.resolve(__dirname, url)

export const mainRoutes = [
  {
    pathname: '/login',
    component: Login
  },
  {
    pathname: '/404',
    component: NotFound
  }
]

export const adminRoutes = [
  {
    pathname: '/admin/home',
    url: resolve('../pages/Home'),
    title: '首页',
    isNav: true,
    icon: 'icon-shouye'
  },
  {
    pathname: '/admin/setting',
    redirect: '/admin/setting/menusetting',
    title: '设置',
    isNav: true,
    icon: 'icon-shezhi',
    children: [
      {
        url: resolve('../pages/MenuSetting'),
        pathname: '/admin/setting/menusetting',
        title: '菜单设置',
        isNav: true,
        icon: 'icon-shezhi'
      },
      {
        url: resolve('../pages/UserSetting'),
        pathname: '/admin/setting/usersetting',
        title: '用户设置',
        isNav: true,
        icon: 'icon-shezhi'
      }
    ]
  },
  {
    pathname: '/admin/notifications',
    url: resolve('../pages/Notifications'),
    isNav: false
  }
]
